package com.xiaoye.qbdatahandle.domian;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xiaoye.qbdatahandle.result.ElementsVo;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.data.mongodb.core.mapping.FieldType;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 分析结果
 */
@Data
@Document(collection = "analysis_result")
public class AnalysisResult {
    /**
     * 主键
     */
    @Id
    private String id;
    /**
     * 简介
     */
    @Field(name = "intro", targetType = FieldType.STRING)
    private String intro;
    /**
     * 要素信息
     */
    @Field(name = "element_info")
    private ElementsVo elementInfo;
    /**
     * 词云图地址
     */
    @Field(name = "word_count_img", targetType = FieldType.STRING)
    private String wordCountImg;

    /**
     * 采集结果id
     */
    @Field(name = "collect_result_id", targetType = FieldType.STRING)
    private String collectionResultId;
    /**
     * 标题
     */
    @Field(name = "collect_result_title", targetType = FieldType.STRING)
    private String collectionResulTitle;
    /**
     * 文章id
     */
    @Field(name = "subject_article_id", targetType = FieldType.STRING)
    private String subjectArticleId;

    /**
     * 创建时间
     */
    @Field(value = "create_time", targetType = FieldType.STRING)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String createTime;

    /**
     * 更新时间
     */
    @Field(value = "update_time", targetType = FieldType.STRING)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String updateTime;

}
